<template>
  <a-spin :spinning="spinning != 0">
    <a-form :form="form"
            layout="horizontal"
            :hideRequiredMark="false"
            style="">
      <a-form-item :label="$t('m.system.portalset.entity.portletCode')" :label-col="{ span:4 }" :wrapper-col="{ span:18 }">
        <a-input
          style="width:100%"
          :disabled="disabledRules.portletCode"
          placeholder=""
          type="text"
          v-decorator="['portletCode', validatorRules.portletCode]"
        />
      </a-form-item>
      <a-form-item :label="$t('m.system.portalset.entity.portletName')" :label-col="{ span:4 }" :wrapper-col="{ span:18 }">
        <a-input
          style="width:100%"
          :disabled="disabledRules.portletName"
          placeholder=""
          type="text"
          v-decorator="['portletName', validatorRules.portletName]"
        />
      </a-form-item>
      <a-form-item :label="$t('m.system.portalset.entity.isDefault')" :label-col="{ span:4 }" :wrapper-col="{ span:18 }">
        <a-select v-decorator="['isDefault', {initialValue:'0', rules: validatorRules.isDefault.rules}]" style="width: 120px">
          <a-select-option value="1">
            是
          </a-select-option>
          <a-select-option value="0">
            否
          </a-select-option>
        </a-select>
      </a-form-item>
    </a-form>
  </a-spin>
</template>

<script>

  import {FormMixin} from '@/mixins/FormMixin'
  import YchConstant from "@/api/YchConstant";

  export default {
    name: "SysportletconfigformModal",
    mixins: [FormMixin],
    data() {
      return {
        validatorRules: {
          portletCode: {
            rules: [{required: true, message: this.$t('m.system.portalset.verify.portletCode')}]
          },
          portletName: {
            rules: [{required: true, message: this.$t('m.system.portalset.verify.portletName')}]
          },
          content: {
            rules: []
          },
          isDefault: {
            rules: []
          },
        },
        disabledRules: {
          portletCode: false,
          portletName: false,
          content: false,
          isDefault: false,
        },
        subTableConfig: {},
        dictConfig: {},
        optionConfig: {},
        url: {
          queryById: YchConstant.PREFIX_SYSTEM + '/portlet/queryById',
          add: YchConstant.PREFIX_SYSTEM + "/portlet/add",
          edit: YchConstant.PREFIX_SYSTEM + "/portlet/edit",
        },
      }
    },
    methods: {},
    watch: {
      editableList: {
        handler() {
          this.editableModel()
        },
        immediate: true
      }
    }
  }
</script>
